#include "publisher.h"
#include <iostream>
#include <thread>
#include <chrono>

int main() {
    bool use_proxy = true;
    bool bind = true;
    std::string address = "tcp://localhost:5555";

    if (use_proxy) {
        bind = false;
        address = "tcp://localhost:5556";
    } else {
        bind = true;
        address = "tcp://localhost:5555";
    }
    PublisherEndpoint publisherEndpoint(address, bind);

    int message_count = 0;
    while (true) {
        publisherEndpoint.publish("Message " + std::to_string(++message_count));
        std::this_thread::sleep_for(std::chrono::seconds(1));
    }

    return 0;
}